use std::collections::HashMap;

#[test]
fn m1() {
    let k1 = "k1";

    let mut m = HashMap::new();
    m.insert(String::from(k1.to_string()), 1);

    let mut m2: HashMap<String, i32> = HashMap::new();
    m2.insert(String::from("k2"), 34);

    println!("{:?} {:?}", m, m2);

    let source = m.get(k1).copied().unwrap_or(0);
    println!("{}", source);
}

#[test]
fn m2() {
    let mut m = HashMap::new();
    m.insert(String::from("k1"), 2);
    m.insert(String::from("k2"), 3);

    for (k, v) in &m {
        println!("{k} {v}");
    }
}
